#include "ProcessData.h"

ProcessData::ProcessData(string line, int index){
	string token;
	istringstream iss(line,ios_base::in);

	getline(iss, token, ' ');
	totalTimeLimit = atoi(token.c_str());

	getline(iss, token, ' ');
	initialPriority = atoi(token.c_str());

	getline(iss, token, ' ');
	b1 = atoi(token.c_str());

	getline(iss, token, ' ');
	b2 = atoi(token.c_str());

	getline(iss, token, ' ');
	c1 = atoi(token.c_str());

	getline(iss, token, ' ');
	c2 = atoi(token.c_str());

	getline(iss, token, ' ');
	w = atoi(token.c_str());

	getline(iss, token, ' ');
	x0 = atoi(token.c_str());

	getline(iss, token, ' ');
	y0 = atoi(token.c_str());

	cout << "Process created with params :" << totalTimeLimit << " "
											<< initialPriority << " "
											<< b1 << " "
											<< b2 << " "
											<< c1 << " "
											<< c2 << " "
											<< w << " "
											<< x0 << " "
											<< y0 << endl;
	runningTime = 0;
	processIndex = index;

}

